<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>二维码</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="/${BasePath}/static/layui/css/layui.css" media="all" />
	<link rel="stylesheet" href="/${BasePath}/static/css/public.css" media="all" type="text/css">
	<style>
		.qrcode{
			width:400px;
			margin: 30px auto
		}
		.code,.link{
			width:300px;
			margin:10px auto
		}
	</style>
</head>
<body class="childrenBody">
	<div class="layui-row layui-col-space10 panel_box">
		<div class="qrcode">
			<div class="code" id="qrcode"></div>
			<div class="link">
				<div class="layui-inline" style="width:175px">
					<input type="text" class="layui-input" id="link" class= readonly="readonly">
				</div>
				<button type="button" class="layui-btn layui-btn-normal" onclick="copylink()">复制链接地址</button>
			</div>
		</div>
	</div>
<script src="/${BasePath}/static/layui/layui.js" charset="utf-8" type="text/javascript"></script>
<script type="text/javascript" src="/${BasePath}/static/js/common/jquery-2.1.0.min.js"></script>
<script src="https://cdn.bootcss.com/jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
<script type="text/javascript">
	$(function(){
		var url = '${url}';
		$('#link').val(url);
		$("#qrcode").qrcode({
            render: "canvas", 
            width: 300, //宽度
            height:300, //高度
            text: url
        });
	})
	function copylink(){ 
	        var copyobject=document.getElementById("link");
	        copyobject.select();
	        document.execCommand("Copy");
	        alert("已复制成功哦~"); 
	}
</script>
</body>
</html>